package com.wltjack.dao;

import com.wltjack.dao.model.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface User4JpaDao extends JpaRepository<User,Long> {

    @Query("select c from #{#entityName} c where c.userName like %:searchText%") // JPQL语句 #{#entityName}代替实体的名称
    Page<User> search(@Param("searchText") String searchText, Pageable pageable);
}
